//
//  MXFindBlockTypeThreeTableViewCell.m
//  MXの衣柜
//
//  Created by 马霄 on 15/8/14.
//  Copyright (c) 2015年 霄 马. All rights reserved.
//

#import "MXFindBlockTypeThreeTableViewCell.h"
#import "MXFindProductodel.h"
#import "UIImageView+WebCache.h"
#import "MXImageSize.h"
@interface MXFindBlockTypeThreeTableViewCell ()

@property (nonatomic, retain) NSMutableArray *productArray;

@end
@implementation MXFindBlockTypeThreeTableViewCell
- (void)dealloc
{
    [_productArray release];
    [_mainImageView release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.mainImageView = [[[UIImageView alloc] init] autorelease];
        
        self.mainImageView.backgroundColor = [UIColor whiteColor];
        
        [self.contentView addSubview:self.mainImageView];
        
        // 全局数组初始化
        self.productArray = [NSMutableArray array];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat WID = self.contentView.frame.size.width;
    CGFloat mainImageViewX = 0;
    CGFloat mainImageViewY = 0;
#warning 图片的宽高需要自适应
    CGFloat mainImageViewW = WID;
    CGFloat mainImageViewH = self.height;
    
    self.mainImageView.frame = CGRectMake(mainImageViewX, mainImageViewY, mainImageViewW, mainImageViewH);
}

// 获得数组
- (void)getBlockModel:(MXFindDetailModel *)blockModel productArr:(NSMutableArray *)productArr
{
    
    NSString *string = blockModel.article;
    
    
    NSArray *FirstArr = [string componentsSeparatedByString:@"|"];
    
    NSString *FirstString = [FirstArr objectAtIndex:0];

    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:FirstString]placeholderImage:[UIImage imageNamed:@"plaseholder"]];
    
//    NSLog(@"%f------%f", self.mainImageView.frame.size.width, self.mainImageView.frame.size.height);
    

    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
